<?php
define('ROOT_PATH', dirname(dirname(dirname(dirname(dirname(__FILE__))))));
define('PROTECTED_PATH', ROOT_PATH . '/protected');
define('APP_PATH', PROTECTED_PATH . '/api');
require_once(PROTECTED_PATH . '/config.php');

$url = upload_one_file('content', 'upload');
if ($url) {
    $CKEditorFuncNum = $_GET['CKEditorFuncNum'];
	//$message = ' 上传成功 ';
	$message = '';
    $re = "window.parent.CKEDITOR.tools.callFunction($CKEditorFuncNum, '$url', '$message')";
} else {
    $re = 'alert("Unable to upload the file")';
}
echo "<script>{$re};</script>";
